//2009/08/13 03:07:27
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>
#include <set>

using namespace std;

class UserName
{
public:
    string newMember(vector <string> exi, string newName)
    {
		set<string> sset;
		set<string>::iterator it;
		for(int i=0; i<exi.size(); i++) sset.insert(exi[i]);
		int sz = sset.size();
		sset.insert(newName);
		if(sset.size() > sz) return newName;
		int num = 1;
		while(1)
		{
			stringstream ss;
			ss << num;
			string s(newName);
			s += ss.str();
			sset.insert(s);
			if(sset.size() > sz) return s;
			num ++;
		}
    }
};
